using UnityEngine;
using System.Collections;

public class Spells {
	
	#region Attributs et assesseur
	private int idSpell;
	public int IdSpell
    {
        get { return idSpell; }
    }
	
	private string name;
	public string Name
    {
        get { return name; }
    }
	
	private string type;
	public string Type	//Attaque, Défense, Contre, Interrupt
    {
        get { return type; }
    }
	
	private int instant;//0 : sort instant  1: sort canaliser  2: un dot
	public int Instant
    {
        get { return instant; }
    }
	
	private int nbTour;
	public int NbTour
    {
        get { return nbTour; }
    }
	
	private int damage;
	public int Damage
    {
        get { return damage; }
		set { damage = value; }
    }
	
	private int constdamage;
	public int ConstDamage
    {
        get { return constdamage; }
    }
	
	private int[]damageDot=new int[10]{ 0, 0, 0, 0, 0, 
										0, 0, 0, 0, 0};
	
	private int cost;
	public int Cost
    {
        get { return cost; }
    }
	
	private int gain;
	public int Gain
    {
        get { return gain; }
    }
	
	private string description;
	public string Description
    {
        get { return description; }
    }
	
	private Texture2D image;
    public Texture2D Image
    {
        get { return image; }
    }
    protected bool isInterrupt;
	public bool IsInterrupt
	{
		get{return isInterrupt;}
		set{isInterrupt = value;}
	}
	#endregion
	
	
	public Spells()
    {
        this.idSpell = 0;
		this.name = "";
		this.type ="";
		this.instant = 0;
		this.nbTour = 0;
		this.damage = 0;
		this.cost = 0;
		this.gain = 0;
		this.description = "";
		this.image = null;
		this.isInterrupt = false;
    }
	
	public Spells(Spells spell)
    {
        this.idSpell = spell.idSpell;
		this.name = spell.name;
		this.type = spell.type;
		this.instant = spell.instant;
		this.nbTour = spell.nbTour;
		this.damage = spell.damage;
		this.constdamage = spell.constdamage;
		this.cost = spell.cost;
		this.gain = spell.gain;
		this.description = spell.description;
		this.image = spell.image;
		this.isInterrupt = spell.isInterrupt;
    }
	
	public Spells(int idSpell, string name,string type, int instant, int nbTour, int damage, int constdamage, int[] damageDot ,int cost, int gain, string description, Texture2D image, bool isInterrupt)
    {
        this.idSpell = idSpell;
		this.name = name;
		this.type = type;
		this.instant = instant;
		this.nbTour = nbTour;
		this.damage = damage;
		this.constdamage = constdamage;
		this.cost = cost;
		this.gain = gain;
		this.description = description;
		this.image = image;
		this.isInterrupt = isInterrupt;
    }
	public int getDamageDot(int index){
		return damageDot[index];
	}
	public void setDamageDot(int index,int valueD){
		damageDot[index] = valueD;
	}
	public override string ToString ()
	{
		return string.Format ("[Spells: IdSpell={0}, Name={1}, Type={2}, Instant={3}, NbTour={4}, Damage={5},ConstDamage={6}, Cost={7}, Description={8}, Image={9}, isInterrupt={10}]", IdSpell, Name, Type, Instant, NbTour, Damage,ConstDamage, Cost, Description, Image, isInterrupt);
	}
}
